/*
+ --------------------------------------------------- +
|  Ineo Article Manager - Version 2.x
|  Copyright 2006-2007, Dan Cryer and William McGann
+ --------------------------------------------------- +

Ineo Article Manager is free software; you can redistribute it and/or modify
it under the terms of version 3 of the GNU General Public License as published by
the Free Software Foundation.

Ineo Article Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ineo; see the file License.txt.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

*/

var current_plugin = '';
var tabcontent = new Array();

function ineo_tab_init()
{
	var alldivs = document.getElementsByTagName('div');
	var tabid = '';
	for( var i = 0; i < alldivs.length; i++ )
	{
		if( alldivs[i].className == 'pp-tabon' || alldivs[i].className == 'pp-taboff' )
		{
			alldivs[i].style.cursor = 'pointer';
			alldivs[i].onclick = ineo_tab_click;
		}
	}
}

function ineo_tab_click( e )
{
	var targ;
	
	if (!e)
	{
		var e = window.event;
	}
	
	if (e.target) 
	{
		targ = e.target;
	}
	else if (e.srcElement)
	{
		targ = e.srcElement;
	}
	
	if (targ.nodeType == 3) // defeat Safari bug
	{
		targ = targ.parentNode;
	}
	
	var tabid = targ.id;
	
	tabid = tabid.substr(4);
	
	document.getElementById('tab-'  + current_plugin).className = 'pp-taboff';
	document.getElementById('tab-'  + tabid).className = 'pp-tabon';

	ineoAjaxReplace('op=get_overview_plugin&opid='+tabid,'pp-main-tab-content','');
	
	current_plugin = tabid;
}